<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected $validator_message;   //验证器验证提示信息

    //构造函数，在类实例化时自动调用
    public function __construct($except = '') {
        //设置时区
        date_default_timezone_set("Asia/Shanghai");    

        //声明验证器验证提示信息
        $this->validator_message = [
            'required' => ':attribute 为必填项',
            'max' => ':attribute 长度不能超过 :max',
            'numeric' => ':attribute 必须是数字',
            'email' => ':attribute 格式不正确',
        ];
    }
}
